<?php

namespace app\validate;

use share\validate\SceneValidate;

class SendTemplateRelationValidate extends SceneValidate{
    protected $rule = [ 
        'id' => 'require', 
        'app_id' => 'require|integer',
        'vendor_id' => 'require|integer',
        'type' => 'require|integer',
        'send_template_id' => 'require|integer',
        'other_id' => 'require|integer',
        'other_type' => 'require|integer',
        'package' => 'require|length:1,60',
        'vendor' => 'require|length:1,60',
        'account' => 'require|length:6,120',
    ];  
    
    protected $sceneRules = [
        'list' => [
            'app_id' => 'integer',
            'vendor_id' => 'name:1,30',
            'scene' => 'length:1,30',
            'type' => 'integer',
            'language' => 'integer',
            'send_template_id' => 'integer',
        ],
        'set' => [
            'send_template_id' => 'require|array',
            'other_id' => 'require|integer',
            'other_type' => 'require|integer',
        ],
    ];
  

    protected $scene = [
        'list' => ['app_id','vendor_id','type','scene','language','send_template_id'],
        'getByApp' => ['other_id','other_type'],
        'del' => ['id'],
        'set' => ['other_id','other_type','send_template_id'],
        'check' => ['type','scene','language','package','vendor'],
        'sendTest' => ['type','scene','language','package','vendor','account'],
    ];
}